package com.neuedu.his.controller;

import com.neuedu.his.po.Checkapply;
import com.neuedu.his.service.CheckapplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/checkapply")
public class CheckApplyController {

    @Autowired
    private CheckapplyService checkapplyService;

    @PostMapping("/add")
    public boolean add(@RequestBody Checkapply checkapply) {
        return checkapplyService.save(checkapply);
    }

    @PostMapping("/delete")
    public boolean delete(@RequestBody Map<String, Integer> params) {
        Integer id = params.get("id");
        return checkapplyService.removeById(id);
    }

    @GetMapping("/list")
    public List<Checkapply> list() {
        return checkapplyService.list();
    }
}